<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<!-- saved from url=(0041)https://www.zretc.net/classrooms/personal -->
<html>
<head>

	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

	<title>GO运动</title>

	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
	<!-- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, viewport-fit=cover"> -->
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<!-- <script type="text/javascript" data-framework src="/webApp/js/common/raven.min.js" crossorigin="anonymous"></script> -->


	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/style/css/elementui.css">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/style/css/elements.css" >
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/style/css/train_banner_429adde.css" >
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/style/css/components_9031f76.css" >
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/style/css/personal_nav_5b79317.css">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/style/css/classroom_a85a9c7.css">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/style/css/iconfont.css">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/style/css/common_dbbbd09.css">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/style/css/lineariconss.css">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/style/css/bootstraps.css">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/style/css/mains.css">
	<script  src="${pageContext.request.contextPath}/style/js/bootstrap.js"></script>
	<link rel="stylesheet" href="${pageContext.request.contextPath}/style/css/bootstrap.min.css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/style/css/dashboard.css">
	<script>
		if (${empty sessionScope.user}) {
			window.location.href='${pageContext.request.contextPath}/login/userLogin.jsp';
		}
	</script>
	<style type="text/css">
		[v-cloak] {
			display: none;
		}

		.training_activity_list_header {
			background-image:url(${pageContext.request.contextPath}/style/images/ct.jpg);
			background-repeat: no-repeat;
			background-size:  1140px 100%;
			background-position:140px 0px ;
		}
	</style>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/style/css/main_269e229.css">
</head>
<body>
<div id="app" style="position: relative; min-height: calc(100vh - 195px);">
	<div class="header_box">
		<header id="header">
			<%--		<div class="header-top">
                        <div class="container">
                            <div class="row align-items-center justify-content-center">
                                <div class="col-md-4 col-4 header-top-left no-padding">
                                  <a href="mailto:support@colorlib.com"><span class="lnr lnr-location"></span></a>
                                  <a class="contact-texts" href="mailto:support@colorlib.com">support@colorlib.com</a>
                                </div>
                                <div class="col-md-4 col-4 header-top-bottom no-padding">
                                  <a href="index1.jsp"><img class="img-fluid" src="${pageContext.request.contextPath}/page/img/logo.png" alt="" title="" /></a>
                                </div>
                                <div class="col-md-4 col-4 header-top-right no-padding">
                                  <a class="contact-texts" href="tel:+440 123 12 658 439">+440 123 12 658 439</a>
                                  <a href="tel:+440 123 12 658 439"><span class="lnr lnr-phone-handset"></span></a>
                                </div>
                            </div>
                        </div>
                  </div>--%>
			<div class="container main-menu">
				<div class="row align-items-center justify-content-center">
					<nav id="nav-menu-container">
						<ul class="nav-menu">
							<li class="menu-active"><a href="${pageContext.request.contextPath}/page/index1.jsp">首页</a></li>
							<li><a href="${pageContext.request.contextPath}/actionlibrary/actionlibrary.jsp">健身课程库</a></li>
							<li><a href="${pageContext.request.contextPath}/page/services.jsp">特设课堂</a></li>
							<li><a href="${pageContext.request.contextPath}/page/trainers.jsp">图库</a></li>
							<li class="menu-has-children"><a href="">更多</a>
								<ul>
									<li><a href="${pageContext.request.contextPath}/front/FavoritePage.jsp">我的收藏</a></li>
									<li><a href="${pageContext.request.contextPath}/front/HistoryPage.jsp">历史记录</a></li>
								</ul>
							</li>
							<li><a href="${pageContext.request.contextPath}/page/elements.jsp">联系我们</a></li>
							<li><a href="${pageContext.request.contextPath}/page/contact.jsp">关于我们</a></li>
							<li>


								<div class="item-group" id="me">

								</div>
							</li>
						</ul>
					</nav><!-- #nav-menu-container -->
				</div>
			</div>
		</header><!-- #header -->
	</div>
	<main style="padding-top: 0px">
		<header>
			<div class="training_activity_list_header" />
			<div class="training_activity_list_header_ware"></div>
			<div class="training_activity_list_userinfo"><img src="${pageContext.request.contextPath}/FileDownloadServlet?fileName=${sessionScope.user.userImg}"
															  onerror='this.src="${pageContext.request.contextPath}/style/images/titlel.jpg"'  class="training_activity_list_portrait">
				<div class="training_activity_list_nickname left">${sessionScope.user.userName}</div>

			</div>
			<c:if test="${sessionScope.user.vipState == '1'}">
				<img src="${pageContext.request.contextPath}/style/images/vip11.png" style="height: 20px;position: absolute;top: 113px;left: 215px;">
			</c:if>
		</header>
		<article>
			<div class="training_activity_list_main clearfix">
				<div class="personalNav">
					<ul>
						<li class="checkon"><a href="#"
											   class="co_333"><span class="iconfont icon-teach p_ibm Mrt20 Mlf30"></span>
							<span>我的作品</span></a></li>
						<li><a href="${pageContext.request.contextPath}/front/FavoritePage.jsp" class="co_333"><span
								class="iconfont icon-homework p_ibm Mrt20 Mlf30"></span>
							<span>收藏</span></a></li>
						<li><a href="${pageContext.request.contextPath}/front/HistoryPage.jsp" class="co_333"><span
								class="iconfont icon-play p_ibm Mrt20 Mlf30"></span> <span>历史记录</span></a>
						</li>
						<li ><a href="${pageContext.request.contextPath}/front/UpdateInfo.jsp" class="co_333"><span
								class="iconfont icon-course p_ibm Mrt20 Mlf30"></span> <span>账号设置</span></a>
						</li>
						<li><a href="${pageContext.request.contextPath}/front/PublishVideo.jsp" class="co_333"><span
								class="iconfont icon-hand_edit p_ibm Mrt20 Mlf30"></span>
							<span>作品发布</span></a></li>
						<li><a href="${pageContext.request.contextPath}/front/PayMembers.jsp" class="co_333"><span
								class="iconfont icon-admin p_ibm Mrt20 Mlf30"></span>
							<span>VIP充值</span></a></li>
						<li id="exitUser"><a href="#" class="co_333"><span
								class="iconfont icon-setup p_ibm Mrt20 Mlf30"></span>
							<span>退出登入</span></a></li>

					</ul>
				</div>
				<div class="training_activity_list_detailed">
					<div class="training_activity_list_detailed_nav clearfix">
						<ul class="left">
							<li class="active">已发布</li>
						</ul>
					</div>
					<div class="Mtp20">
						<ul class="vc_classroom" id="show">
						</ul>
						<div id="showPageInfo" class="col-md-12 text-center" style="position: absolute; left: 130px;"></div>
						<div class="col-md-12 text-center"  style="position: absolute;left:130px;">
							<ul class="pagination pagination-lg" id="pageItem">
							</ul>
						</div>
					</div>
				</div>
			</div>
		</article>
	</main>
</div>

<script type="text/javascript" data-loader="" src="${pageContext.request.contextPath}/style/js/config_b47c63a.js"></script>
<script type="text/javascript" data-loader="" src="${pageContext.request.contextPath}/style/js/jquery.min.js"></script>
<script type="text/javascript" data-loader="" src="${pageContext.request.contextPath}/style/js/remoteCall_77ab826.js"></script>
<script type="text/javascript" data-loader="" src="${pageContext.request.contextPath}/style/js/lodash.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/style/js/vue_63f7cd8.js"></script>
<script type="text/javascript" data-loader="" src="${pageContext.request.contextPath}/style/js/util_fad37ea.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/style/js/elementui.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/style/js/train_banner_66263da.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/style/js/components_52f8782.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/style/js/personal_nav_be8c381.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/style/js/classroom_63b138d.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/style/js/personal_87e9220.js"></script>
<div class="login_bomb_box" style="display: none;">
	<div class="login_bomb_cancel"></div>
	<div class="wisdom_login posf border1">
		<div class="posa" style="width: 110px; top: -50px; left: 106px;"><img
				src="${pageContext.request.contextPath}/style/images/userName.png" alt="" class="wido100"></div>
		<div class="posa" style="width: 110px; top: -50px; left: 106px; display: none;"><img
				src="${pageContext.request.contextPath}/style/images/pwd.png" alt="" class="wido100"></div>
		<div class="input_text Mtp30 posr"><input type="text" placeholder="手机号" class="F14"> <span
				class="posa co_798f9c iconfont icon-username"></span> <span class="posa iconfont icon-close"
																			style="display: none;"></span></div>
		<div class="input_password Mtp25 posr"><input type="password" placeholder="密码" class="F14"> <span
				class="posa co_798f9c iconfont icon-password"></span> <span class="posa iconfont icon-close"
																			style="display: none;"></span></div>
		<div class="Mtp20"><input id="remember" type="checkbox" class="p_ibm Mrt5 Mlf15"
								  style="width: 16px; height: 16px;"> <label for="remember" class="F12 co_526e7a">记住密码</label> <a
				target="_top"
				href="http://user.futurelab.tv/#/UserCenterLogin?platformCode=ZHJXY&amp;redirectUrl=https%3A%2F%2Fwww.zretc.net%2Fclassrooms%2Fpersonal"
				class="right co_09f F12">联合登录&gt;&gt;</a></div> <input type="button" value="登录"
																	   class="login_btn Mtp25 F16 Center">
		<button style="position: relative;left: 20px;border:none;"></button>
	</div>
</div>
<script>
	document.write('<script src="//' + (location.host || 'localhost').split(':')[0] +
			':35929/livereload.js?snipver=1"></' + 'script>')
</script>
<script src="//127.0.0.1:35929/livereload.js?snipver=1"></script>

<script type="text/javascript">
	$(function () {

		var userId="<c:out value='${sessionScope.user.userId}' />";
		$.get("${pageContext.request.contextPath}/VideoPersonageController/queryAllVideoByUserId",{userId:userId},function (data) {
			showData(data)
		})


		/*
                删除作品
            */
		$(document).on ("click",".delBth",function () {
			var flag = confirm("是否确认删除")
			if(flag) {
				$.get("${pageContext.request.contextPath}/VideoPersonageController/deleteVideoByVideoId", {videoId:this.getAttribute("value")}, function (data) {
					if(data) {
						alert("删除成功");
						var pageNo = parseInt($("#pageNo").text());
						var pageSize = parseInt($("#pageSize").text());
						var pagenum;
						if (pageNo == 1) {
							pagenum = 1;
						}else if(pageNo!=1 && pageSize==1) {
							pagenum = pageNo - 1;
						} else if(pageNo!=1 && pageSize!=1) {
							pagenum = pageNo;
						}
						$.get("${pageContext.request.contextPath}/VideoPersonageController/queryAllVideoByUserId", {userId:"${sessionScope.user.userId}", pageNum:pagenum}, function (data) {
							showData(data);
						})
					} else {
						alert("删除失败");
					}
				})
			}
		})

		if (${not empty requestScope.abs}){
			alert("已提交至管理员审核")
		}

		/*
                点击跳转页数
            */
		$(document).on ("click",".jump",function () {
			$.get("${pageContext.request.contextPath}/VideoPersonageController/queryAllVideoByUserId", {userId:"${sessionScope.user.userId}", pageNum:this.getAttribute("value")}, function (data) {
				showData(data);
			})
		})

		/*
           输入页数跳转
       */
		$(document).on ("click","#jumpPage",function () {
			var pageNo = parseInt($("#jumpPageText").val());
			if( pageNo < 1 ) {
				pageNo = 1;
			} else if(pageNo > $("#totalPage").text()*1) {
				pageNo = $("#totalPage").text();
			}
			$.get("${pageContext.request.contextPath}/VideoPersonageController/queryAllVideoByUserId", {userId:"${sessionScope.user.userId}", pageNum:pageNo}, function (data) {
				showData(data);
			})
		})

		/*
            * 退出登入
            * */
		$("#exitUser").click(function () {
			var leep = confirm("确认退出");
			if(leep) {
				$.get("${pageContext.request.contextPath}/UserController/exit", function (data) {
					location.href="${pageContext.request.contextPath}/login/userLogin.jsp";
				})
			}
		})
	})

	function showData(result){
		//每一次遍历之前需要清空
		$("#show").empty();
		$("#pageItem").empty();
		$("#showPageInfo").empty();
		//显示文章列表数据
		$.each(result.list,function(index,video){
			$("#show").append('<li class="li p_ibt"  style="margin-right: 30px;"><a\n' +
					'                                            href="${pageContext.request.contextPath}/VideoOfTypeController/showVideoPlay?videoId='+ video.videoId +'" >\n' +
					'                                        <div class="classroom_img"\n' +
					'                                             style="background-image: url(${pageContext.request.contextPath}/FileDownloadServlet?fileName='+ video.videoImg +');">\n' +
					'                                        </div>\n' +
					'                                    </a>\n' +
					'                                        <div class="assistant_flag" style="display: none;">助</div>\n' +
					'                                        <div class="assistant_flag" style="display: none;">管</div>\n' +
					'                                        <div class="classroom_detail">\n' +
					'                                            <div class="tech_type" style="background-color: rgb(255, 186, 73);">\n' +
					'                                                健身</div>\n' +
					'                                            <div class="tech_type" style="background-color: rgb(126, 211, 33);">\n' +
					'                                                标准课堂</div>\n' +
					'                                            <div class="tech_type" style="background-color: rgb(148, 132, 240);">\n' +
					'                                                云视频</div>\n' +
					'                                            <h2 title="Java方向企业人才技术栈" class="classroom_name">' + video.courseName + '</h2>\n' +
					'                                            <div class="fold_panel">\n' +
					'                                                <p class="description">' + video.videoIntroduce + '</p>\n' +
					'                                            </div>\n' +
					'                                            <div class="count_box" style="width:400px;">\n' +
					'                                                <div class="p_ibm WTO wido30"><span>发布者：</span> <span>${sessionScope.user.userName}</span>\n' +
					'                                                </div>\n' +
					'                                                <div class="p_ibm WTO wido30" > <button class="delBth" style="position: relative;left: 70px;border-style:none;" value="'+ video.videoId +'">删除作品</button>\n' +
					'                                                </div>\n' +
					'                                            </div>\n' +
					'                                        </div>\n' +

					'                                        <div class="control_box"><span class="iconfont icon-checkbox"\n' +
					'                                                                       style="display: none;"></span></div>\n' +
					'                                        <div class="mask_box" style="display: none;"></div>\n' +
					'                                    </li>')
		})

		if (result.list == '') {
			$("#show").append('<img src="${pageContext.request.contextPath}/style/images/no_data.png" style="height: 175px;position: relative;top: 50px;left: 270px;">');
			$("#show").append('<div class="prom_txt" style="position: relative;left: 240px;top: 40px">你还没有发布作品哦，快去发布吧！</div>');
			return;
		}
		//显示分页信息
		$("#showPageInfo").append("当前第<span id='pageNo'>" + result.pageNum +
				"</span>页/共<span id='totalPage'>"+result.pages +
				"</span>页/当前页显示<span id='pageSize'>"+result.size+
				"</span>条/共<span id='totalCount'>"+result.total +"</span>条");
		//分页栏
		//首页
		if(1==result.pageNum){
			$("#pageItem").append('<li class="disabled"><a class="jump" value="1">首页</a></li>');
		}else{
			$("#pageItem").append('<li><a class="jump" value="1">首页</a></li>');
		}
		//上一页
		if("1"==result.pageNum){
			$("#pageItem").append('<li class="disabled"><a class="jump" value="'+(result.pageNum)+'">上一页</a></li>');
		}else{
			$("#pageItem").append('<li><a class="jump" value="'+(result.pageNum-1)+'">上一页</a></li>');
		}
		//分页栏目
		for(var i=1;i<=result.pages;i++){
			if(i==result.pageNum){
				$("#pageItem").append('<li class="active"><a class="jump" value="'+i+'">'+i+'</a></li>');
			}else{
				$("#pageItem").append('<li><a class="jump" value="'+i+'">'+i+'</a></li>');
			}
		}
		//下一页
		if(result.pages==result.pageNum){
			$("#pageItem").append('<li class="disabled"><a class="jump" value="'+(result.pageNum)+'">下一页</a></li>');
		}else{
			$("#pageItem").append('<li><a class="jump" value="'+(result.pageNum+1)+'">下一页</a></li>');
		}
		//末页
		if(result.pages==result.pageNum){
			$("#pageItem").append('<li class="disabled"><a id="last" class="jump" value="'+result.pages+'">末页</a></li>');
		}else{
			$("#pageItem").append('<li><a class="jump" value="'+result.pages+'">末页</a></li>');
		}
		//跳转页
		$("#pageItem").append('<li><a><input id="jumpPageText" style="height:20px;width:45px" type="number" min="1" max="'+result.pages+'"></a></li>');
		$("#pageItem").append('<li><a id="jumpPage">跳转</a></li>');
	}
</script>
</body>

</html>
